/*************************************
* Copyright 2016 elementary LLC.     *
* This file is part of elementary.io *
*************************************/

h1 a.heading-link,
h2 a.heading-link,
h3 a.heading-link,
h4 a.heading-link,
h5 a.heading-link,
h6 a.heading-link {
    color: inherit;
    fill: inherit;
    position: relative;
}

h1 a.heading-link:hover,
h2 a.heading-link:hover,
h3 a.heading-link:hover,
h4 a.heading-link:hover,
h5 a.heading-link:hover,
h6 a.heading-link:hover {
    color: #08c;
    fill: #08c;
}

h1 a.heading-link:active,
h2 a.heading-link:active,
h3 a.heading-link:active,
h4 a.heading-link:active,
h5 a.heading-link:active,
h6 a.heading-link:active {
    text-decoration: none;
}

h1 a.heading-link:hover::before,
h2 a.heading-link:hover::before,
h3 a.heading-link:hover::before,
h4 a.heading-link:hover::before,
h5 a.heading-link:hover::before,
h6 a.heading-link:hover::before {
    content: "\f0c1";
    font-family: FontAwesome;
    font-size: 0.75em;
    left: -1.25em;
    position: absolute;
    top: 0.5em;
}

.clear-float {
    clear: both;
    padding-top: 32px;
}

img.float-left {
    margin-right: 24px;
}

code,
pre,
kbd {
    border: 1px solid lightgrey;
    border-radius: 3px;
    font-family: "Roboto Mono", monospace;
    font-size: 90%;
    padding: 2px 4px;
    text-align: justify;
    white-space: nowrap;
}

kbd {
    background-color: #f0f0f0;
    border-color: #bfbfbf;
    box-shadow:
        inset 0 1px 0 0 #fff,
        inset 0 -2px 0 0 #d9d9d9;
    display: inline-block;
    font-size: 80%;
    margin: 3px;
    min-width: 22px;
    text-align: center;
    user-select: none;
}

code {
    background-color: #f1f2f7;
    color: #403757;
}

pre {
    overflow: auto;
    padding: 8px;
}

pre > code {
    border: none;
    padding: 0;
    white-space: pre;
}

/**********
* Buttons *
**********/

.button {
    display: table;
    margin: 0 auto;
}

@media screen and (max-width: 600px) {
    #operating-system-choices .button {
        font-size: 14px;
        padding: 14px;
    }
}

/***************
* Line numbers *
***************/

pre.highlighted {
    border: none;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.24);
    padding: 0;
}

pre.highlighted code {
    border-radius: 0 3px 3px 0;
    line-height: 1.5em;
}

pre.highlighted .pre-numbering {
    background-color: #eee8d5;
    border-radius: 3px 0 0 3px;
    color: #9faaa9;
    float: left;
    font-size: 90%;
    line-height: 1.5em;
    list-style: none;
    margin: 0;
    min-width: 2.5em;
    padding: 0.5em;
    text-align: right;
    user-select: none;
}

p + p {
    margin-top: 2em;
}

p + h1,
pre + h1 {
    margin-top: 128px;
}

nav {
    background-color: #403757;
    color: #fff;
    fill: #fff;
    position: relative;
    z-index: 100;
}

/**********
* Sidebar *
**********/

.sidebar {
    background-color: #fcfcfc;
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    height: calc(100% - 56px);
    list-style-type: none;
    overflow: auto;
    position: absolute;
    width: 300px;
}

.sidebar.sticky {
    left: 0;
    position: fixed;
    top: 0;
}

.sidebar a {
    color: #666;
    display: block;
    font-size: 90%;
    overflow: hidden;
    padding-right: 6px;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar a:hover {
    color: #403757;
}

.sidebar > ul {
    padding: 0;
}

.sidebar > ul,
.sidebar ul ul,
.sidebar ul ul ul {
    list-style-type: none;
}

.sidebar li.active {
    background-color: rgba(0, 0, 0, 0.1);
}

.sidebar > ul.index > li > a {
    font-weight: 600;
    line-height: 24px;
    padding-left: 16px;
    padding-right: 16px;
}

.sidebar > ul.index {
    display: block;
    flex: 1 1 auto;
    margin: 0;
    overflow: auto;
    padding: 16px 0;
    width: 100%;
}

.sidebar > ul.actions {
    background-color: rgba(0, 0, 0, 0.05);
    background-image:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.12),
            rgba(0, 0, 0, 0) 2px
        );
    border-top: 1px solid rgba(0, 0, 0, 0.18);
    display: block;
    flex: 0 0 auto;
    margin: 0;
}

.sidebar > ul.actions > li {
    display: inline-block;
    margin: 0;
    padding: 12px;
    text-align: center;
}

.sidebar > ul.actions > li .fa {
    margin-right: 6px;
}

.sidebar > ul.actions > li:not(:first-child) {
    border-left: 1px solid rgba(0, 0, 0, 0.12);
}

@media (max-width: 990px) {
    .sidebar {
        display: none;
    }
}

@media (min-width: 990px) {
    .has-sidebar .row.docs {
        margin: 0 auto;
        max-width: 1100px;
        padding-left: 324px;
    }
}

/**********
 * Tables *
 **********/

table {
    background-color: transparent;
    border: 1px solid #ddd;
    border-spacing: 0;
    clear: both;
    font-family: 'Roboto Mono', monospace;
    font-weight: 400;
    text-align: left;
    width: 100%;
}

table th {
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    text-align: left;
}

th,
td {
    margin-left: 1em;
    padding-right: 1em;
}

th:nth-child(1) th:nth-child(1) {
    text-align: left;
}

table > tbody > tr > td:nth-child(1) {
    width: 224px;
}

table > tbody > tr:nth-child(odd) > td,
table > tbody > tr:nth-child(odd) > th {
    background-color: rgba(0, 0, 0, 0.01);
}

table > thead > tr > th,
table > tbody > tr > th,
table > tfoot > tr > th,
table > thead > tr > td,
table > tbody > tr > td,
table > tfoot > tr > td {
    padding: 8px;
    vertical-align: top;
    border-top: 1px solid #ddd;
}

table > thead > tr > th {
    border-top: none;
}

table > tr {
    border-right: 1px solid #ddd;
}

/****************
 * Icons Styles *
 ****************/

img.hig-icons-example {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: inline-block;
    margin: 2em auto;
    width: 100%;
    height: auto;
    max-height: 512px;
    max-width: 512px;
    background: center no-repeat;
    background-size: 100%;
}

img.hig-icon {
    display: inline-block;
    vertical-align: bottom;
    margin: 1em;
}

div.icons-container {
    text-align: center;
    width: 100%;
}

div.icons-container.small-screen {
    display: none;
}

div.icons-container > img,
div.icons-container > span {
    display: inline-block;
    vertical-align: bottom;
    margin: 0.5em 1em;
}

div.icons-container > span {
    font-size: 0.918em;
    text-align: center;
}

div.icons-container > span:nth-child(1) { width: 16px; }
div.icons-container > span:nth-child(2) { width: 24px; }
div.icons-container > span:nth-child(3) { width: 32px; }
div.icons-container > span:nth-child(4) { width: 48px; }
div.icons-container > span:nth-child(5) { width: 64px; }
div.icons-container > span:nth-child(6) { width: 128px; }

@media only screen and (max-width: 600px) {
    div.icons-container > span,
    div.icons-container > img {
        margin: 0.5em;
    }
}

div.icons-container.small-screen {
    display: none;
}

@media only screen and (max-width: 450px) {
    #s128 {
        display: none;
    }

    div.icons-container.small-screen {
        display: block;
    }
}

/*********
* Dialog *
**********/

.dialog {
    width: 380px;
    padding-top: 0;
}

.dialog p {
    font-size: 12px;
    line-height: 17px;
    margin-top: 0;
    margin-bottom: 12px;
}

.dialog p.primary {
    font-size: 14px;
}

.dialog .button {
    font-size: 12px;
    padding: 3px 12px;
    flex: 0 35%; /* FIXME: These values are bullshit */
}

.dialog img {
    display: inline-block;
    margin-right: 12px;
}

.dialog .action-area {
    margin-top: 0;
}

.dialog .content-area {
    width: calc(100% - 48px - 12px); /* Subtract icon width and right margin */
}

.guide {
    border: 0 #c6262e solid;
    color: #c6262e;
    opacity: 0;
    transition: all 200ms ease-in-out;
}

.dialog:hover .guide {
    opacity: 1;
}

.guide.horizontal {
    border-top-width: 1px;
    border-bottom-width: 1px;
    height: 24px;
    width: 420px;
    margin-left: -24px;
    text-align: right;
}

#dialog-guide-action {
    margin-top: -16px;
}
